import matplotlib.pyplot as plt
plt.rcParams['font.family'] = 'SimHei'
x1= [2018,2019,2020,2021]
wuhan = [47539/16823.5,46010/17272.83,50362/16438.5,55297/16885.33]
nanjing = [52916/26391.58,57630/28769.5,60606/28511.67,66140/29131.75]
guangzhou=[59982.1/32088,65052.1/31692,68304.1/33364,74416/34962]
shenzhen = [57543.60/53205,62522/54790,64878/56785,70847/57313]
beijing = [62361/59868,67756/58568,69434/57561,75002/58740]
shanghai = [64183/49446,69442/53722,72232/52530,78027/54427]
plt.plot(x1,shanghai,'p-',label='上海')
plt.plot(x1,beijing,'x-',label='北京')
plt.plot(x1,guangzhou,'d-',label='广州')
plt.plot(x1,shenzhen,'h-',label='深圳')
plt.plot(x1,wuhan,'s-',label='武汉')
plt.plot(x1,nanjing,'D-',label='南京')
plt.xlabel('年份')
plt.ylabel('人均收入/每平方米房价')
plt.title('六大城市人均收入、房价比例图')
plt.legend(bbox_to_anchor=(1, 0), loc=3, borderaxespad=0)
plt.show()
